//
//
//  Created by MS on 15-6-23.
//  Copyright (c) 2015年 MS. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"
typedef enum{
    RequestTypeGet = 0,
    RequestTypePost,
}AFRequestType;
@interface RequestHttpTool : NSObject
/**
 *  发送一个GET请求
 *
 *  @param url     请求路径
 *  @param params  请求参数
 *  @param success 请求成功后的回调
 *  @param failure 请求失败后的回调
 */
+(void)get:(NSString *)url params:(NSDictionary *)params success:(void (^)(id responseObj))success failure:(void(^)(NSError *error))failure;
/**
 *  HTTP请求
 *
 *  @param url     请求路径
 *  @param type    请求类型
 *  @param params  请求参数
 *  @param success 请求成功后的回调
 *  @param failure 请求失败后的回调
 */
+(void)requestWithUrl:(NSString *)url requestType:(AFRequestType)type params:(NSDictionary *)params success:(void (^)(id responseObj))success failure:(void(^)(NSError *error))failure;

/**
 *  发送一个POST请求
 *
 *  @param url     请求路径
 *  @param params  请求参数
 *  @param success 请求成功后的回调
 *  @param failure 请求失败后的回调
 */

+(void)post:(NSString *)url params:(NSDictionary *)params success:(void (^)(id responseObj))success failure:(void(^)(NSError *error))failure;

/**
 *  发送一个GET请求
 *  请求超时10s
 */

+ (void)AFNManagerGet:(NSString *)url params:(NSDictionary *)params success:(void (^)(id responseObj))success failure:(void(^)(NSError *error,id responseObj))failure;

/**
 *  发送一个POST请求
 *  请求超时10s
 */
+ (void)AFNManagerPost:(NSString *)url params:(NSDictionary *)params success:(void (^)(id responseObj))success failure:(void(^)(NSError *error,id responseObj))failure;

@end
